<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<html>
<head>
    <title>Title</title>
</head>
<script>
    function kai() {
        location.href="jsp/addDevice.jsp"
    }
</script>
<body>
<h2>智慧家庭控制系统</h2>
<table border="1">
        <th><input type="button" value="添加设备" onclick="kai()"></th>
<tr>
    <th>设备编号</th>
    <th>设备名称</th>
    <th>运行状态</th>
    <th>维护日期</th>
    <th>操作</th>
    <th>操作</th>
</tr>
    <c:forEach items="${list}" var="dervice">
        <tr>
            <th>${dervice.deviceNo}</th>
            <th>${dervice.deviceName}</th>
            <th>${dervice.status == 0 ? "启用" : "停用"}</th>
            <th>${dervice.maintainDate}</th>
            <th><a href="/update?status=${dervice.status ==0 ? 1 : 0}&id=${dervice.id}">${dervice.status == 0 ? "停用": "启用"}</a></th>
            <th><a href=""></a>删除</th>
        </tr>
    </c:forEach>
</table>
${msg}
</body>
</html>
